//
//  HSongItem.h
//  HMusicPlayer
//
//  Created by Hament on 14/9/18.
//  Copyright (c) 2014年 HJ. All rights reserved.
//


#import "HsqlEntity.h"
#import "DOUAudioFile.h"
@class FMResultSet,HPlaylistItem,iTunesFileTrack;
@interface HSongItem : HsqlEntity <NSCoding,NSPasteboardWriting, NSPasteboardReading,DOUAudioFile>

@property (nonatomic,strong) NSString * songType;//mp3 ,ogg, m4a,aiff ...
@property (nonatomic,strong) NSString * localPath;//local path
@property (nonatomic,strong) NSString * urlPath; //歌曲网络路径

//歌曲名,用户导入的时候一并写入数据库,最开始为(tab取得名称或文件名),用户可右击修改,档用户更改tab信息时,name应该被更新
@property (nonatomic,strong) NSString * songName;

//在用户导入的时候一并写入数据库
@property (nonatomic) NSUInteger  songDuration; //毫秒

@property (nonatomic,strong) NSString * album;//专辑名称
@property (nonatomic,strong) NSString * artist;//演唱家
@property (nonatomic,strong) NSData * bookmark;//sandbox  nsurl

@property (nonatomic,strong) NSString * lyricsLocalPath;//本地歌词路径
@property (nonatomic,strong) NSString * albumLocalPath;//专辑封面路径
@property (nonatomic,strong) NSString * trackInfo; //音轨信息,如ape文件等,跟cd里面的音轨概念不太一样
@property (nonatomic,strong) NSString * playListSyncID; //自定义播放列表的syncID
@property (nonatomic) BOOL  islike;//是否收藏



//-----------DB以外-------------
@property (nonatomic) BOOL generateByItunesLibrary;//这个已经没用了 ,never used
@property (nonatomic, strong) NSURL *audioFileURL;


//-(void)assignWithItem:(HSongItem*)songitem;

//isfavourite: 是否来自itunes favourite 
-(id)initWithItuneTrackDic:(NSDictionary *)ituneTrackDic isfavourite:(BOOL)flag;


//isfavourite: 是否来自itunes favourite
-(id)initWithItuneTrackEntity:(iTunesFileTrack *)ituneTrack isfavourite:(BOOL)flag;

//从db获取实体类
-(id)initWithResultset:(FMResultSet *)rs;
-(id)initWithResultset:(FMResultSet *)rs andPlaylistItem:(HPlaylistItem*)pitem;


//temp
+(id)tempSongItemWithPath:(NSString*)path;

@end
